package com.yunduansing.demo.service;

import com.yunduansing.demo.entity.DepartEntity;
import com.yunduansing.demo.exception.RecordExistsException;
import com.yunduansing.demo.model.common.PageRequestModel;
import com.yunduansing.demo.model.common.PageResultModel;
import com.yunduansing.demo.model.depart.DepartTreeModel;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 部门表 服务类
 * </p>
 *
 * @author yunduansing
 * @since 2020-05-24
 */
public interface DepartService extends IService<DepartEntity> {
    /**
     * 分页
     * @param model
     */
    PageResultModel<DepartEntity> getPage(PageRequestModel model);
    /**
     * 创建
     */
    boolean create(DepartEntity entity) throws RecordExistsException;
    /**
     * 修改
     */
    boolean update(DepartEntity entity) throws RecordExistsException;
    /**
     * 获取tree
     * @param enabled true:表示只获取启用的，否则获取启用和禁用的
     * @return
     */
    List<DepartTreeModel> getTree(boolean enabled);
    /**
     * 查询所有
     * @return
     */
    List<DepartEntity> getAll();
}
